package com.young.web.ec.persistence.domain.fixture;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;

import com.young.web.ec.persistence.domain.Ingredient;
import com.young.web.ec.persistence.domain.MenuItem;
import com.young.web.ec.persistence.domain.Order;

public class PersistenceFixture {
	
	public static MenuItem eggFriedRice() {
		MenuItem item = new MenuItem();
		item.setDescription("Rice, Egg Fried");
		item.setName("Yummy Rice");
		item.setCost(new BigDecimal("12.99"));
		item.setIngredients(new HashSet<Ingredient>(Arrays.asList(
				new Ingredient("Rice", "Straight White Rice"), new Ingredient(
						"Egg", "Chicken Eggs"))));

		return item;
	}
	
	public static MenuItem standardItem() {
	    MenuItem item = new MenuItem();
	    item.setDescription("Peanutty Noodles, perfect for every occasion.");
	    item.setName("Yummy Noodles");
	    item.setCost(new BigDecimal("12.99"));
	    item.setIngredients(new HashSet<Ingredient>(
	        Arrays.asList(
	            new Ingredient("Noodles", "Crisp, lovely noodles"),
	            new Ingredient("Egg", "Used in the noodles"),
	            new Ingredient("Peanuts", "A Nut")
	        )));

	    return item;
	  }

	public static Order standardOrder() {

	    Order order = new Order(new Date());

	    Map<String, Integer> items = new HashMap<String, Integer>();

	    items.put("yummy1", 15);
	    items.put("yummy3", 12);
	    items.put("yummy5", 7);

	    order.setOrderItems(items);

	    return order;
	  }

}
